﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucComment" TagName="Comment" Src="../Common/Inc/Comment.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Crd1013m.aspx.cs" Inherits="Updms.Crd.Crd1013m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Crd1013m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Crd1013m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_favorite" Text="즐겨찾기" runat="server" CssClass="ibtn ibtn_favorite"></asp:linkbutton>
				<asp:linkbutton id="ibtn_delete" Text="삭제" runat="server" CssClass="ibtn ibtn_delete" OnClientClick="return chkDelete()" OnClick="ibtn_delete_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClientClick="return chkSearch(event)" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_card_cd" Text="카드" runat="server" /></td>
					<td class="ctl" width="22%"><asp:dropdownlist id="ddl_search_card_cd" runat="server" CssClass="ddl"></asp:dropdownlist></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_account" Text="계정" runat="server" /></td>
					<td class="ctl" width="22%"><img src="../Common/Images/application_form.png" align="absmiddle" alt="multi_check" class="hand" onclick="showHiddenDiv('div_search_account', event);" /></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_biz_dt" Text="카드사용일" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_biz_from_dt" runat="server" CssClass="ib_b_dt"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_search_biz_from_dt" class="ci_calendar" runat="server">&nbsp;~&nbsp;<asp:textbox id="txt_search_biz_to_dt" runat="server" CssClass="ib_b_dt"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_search_biz_to_dt" class="ci_calendar" runat="server"></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 페이지모드 전환버튼 시작 -->
			<div class="page_mode_area">
				<span id="btn_chg_mode" onclick="return chgMode()" runat="server"></span>
				<span id="btn_init_mode" title="초기화" class="sbtn sbtn_init" onclick="return initDetail()"></span>
			</div>
			<!-- 페이지모드 전환버튼 끝 -->
			<!-- 디테일1 시작 -->
			<table class="table_detail">
				<tr>
					<td style="text-align:center;" class="ctl" width="10%" rowspan="4"><img id="img_card_image" alt="" height="60" runat="server" /></td>
					<td class="lbl" width="10%"><asp:Literal id="ltr_ins_cd" Text="할부코드" runat="server" /></td>
					<td class="ctl" width="20%"><asp:label id="lbl_ins_cd" runat="server" Font-Bold="True"></asp:label></td>
					<td class="lbl" width="10%"><asp:Literal id="ltr_account" Text="계정" runat="server" /></td>
					<td class="ctl" width="20%"><asp:dropdownlist id="ddl_account" runat="server" CssClass="ddl"></asp:dropdownlist></td>
					<td class="lbl" width="10%"><asp:Literal id="ltr_biz_dt" Text="카드사용일" runat="server" /></td>
					<td class="ctl" width="20%"><asp:textbox id="txt_biz_dt" runat="server" CssClass="ib_b_dt req"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_biz_dt" class="ci_calendar" runat="server"></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal id="ltr_contents" Text="결제내용" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_contents" runat="server" Width="97.5%" CssClass="ib_b req"></asp:textbox></td>
					<td class="lbl"><asp:Literal id="ltr_amount" Text="결제금액" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_amount" runat="server" Width="97.5%" CssClass="ib_b_R req"></asp:textbox></td>
					<td class="lbl"><asp:Literal id="ltr_latitude_longitude" Text="위도/경도" runat="server" /></td>
					<td class="ctl">
						<ul class="horizontal">
							<li style="width:44%;"><asp:textbox id="txt_latitude" runat="server" CssClass="ib_b" Width="96%"></asp:textbox></li>
							<li style="width:1%;">&nbsp;</li>
							<li style="width:44%;"><asp:textbox id="txt_longitude" runat="server" CssClass="ib_b" Width="97%"></asp:textbox></li>
							<li style="width:1%;">&nbsp;</li>
							<li style="width:10%;"><img src="../Common/Images/map.png" align="absmiddle" alt="map" class="hand" onclick="showNaverMapEdit();" /></li>
						</ul>
					</td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal id="ltr_ins_total_cnt" Text="총차수" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_ins_total_cnt" runat="server" Width="97.5%" CssClass="ib_b req"></asp:textbox></td>
					<td class="lbl"><asp:Literal id="ltr_paymnt_yn" Text="결제완료" runat="server" /></td>
					<td class="ctl"><asp:radiobuttonlist id="rbl_paymnt_yn" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow">
							<asp:ListItem Value="Y">Y</asp:ListItem>
							<asp:ListItem Value="N" Selected="True">N</asp:ListItem>
						</asp:radiobuttonlist></td>
					<td class="lbl" rowspan="2"><asp:Literal id="ltr_remark" Text="비고" runat="server" /></td>
					<td class="ctl" rowspan="2"><asp:textbox id="txt_remark" runat="server" Width="95.2%" TextMode="MultiLine" Rows="4" Height="37px" CssClass="tb_scroll"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl">　<asp:LinkButton id="lbtn_ins_st_dt" runat="server" Font-Underline="True" ToolTip="할부시작일계산" OnClick="lbtn_ins_st_dt_Click"><asp:Literal id="ltr_ins_st_dt" Text="할부시작일" runat="server" /></asp:LinkButton></td>
					<td class="ctl"><asp:DropDownList id="ddl_ins_st_dt" runat="server" CssClass="ddl"></asp:DropDownList></td>
					<td class="lbl">　<asp:LinkButton id="lbtn_ins_ed_dt" runat="server" Font-Underline="True" ToolTip="할부종료일계산" OnClick="lbtn_ins_ed_dt_Click"><asp:Literal id="ltr_ins_ed_dt" Text="할부종료일" runat="server" /></asp:LinkButton></td>
					<td class="ctl"><asp:DropDownList id="ddl_ins_ed_dt" runat="server" CssClass="ddl"></asp:DropDownList></td>
				</tr>
			</table>
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<div class="div_right"><asp:checkbox id="cb_list_all" runat="server" AutoPostBack="True" OnCheckedChanged="cb_list_all_CheckedChanged" ToolTip="Show All"></asp:checkbox></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Seq,Card_Cd,Account,Confirm_Yn,Remark,Latitude,Longitude" ShowFooter="True">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:BoundField DataField="Card_Cd" HeaderText="Card_Cd(X)" Visible="False" />
								<asp:BoundField DataField="Card_Nm" HeaderText="카드" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_Cd" HeaderText="할부코드" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Account" HeaderText="Account(X)" Visible="False" />
								<asp:BoundField DataField="Account_Nm" HeaderText="계정" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="12%" />
								</asp:BoundField>
								<asp:TemplateField HeaderText="결제내용">
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("Contents") %>'></asp:LinkButton>
									</ItemTemplate>
									<HeaderStyle CssClass="lbtn_rc balloon" />
									<ItemStyle HorizontalAlign="Left" Width="14%" />
								</asp:TemplateField>
								<asp:BoundField DataField="Amount" HeaderText="결제금액" DataFormatString="{0:#,##0}" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Right" Width="9%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_Total_Cnt" HeaderText="총차수" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="5%" />
								</asp:BoundField>
								<asp:BoundField DataField="Biz_Dt" HeaderText="카드사용일" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_St_Dt" HeaderText="할부시작일" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_Ed_Dt" HeaderText="할부종료일" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Remark" HeaderText="Remark(X)" Visible="False" />
								<asp:BoundField DataField="Paymnt_Yn" HeaderText="결제완료" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Confirm_Yn" HeaderText="Confirm_Yn(X)" Visible="False" />
								<asp:BoundField DataField="Confirm_Yn_Icon" HeaderText="확정" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="NaverMap_Link" HeaderText="위치" HtmlEncode="False" >
									<HeaderStyle Font-Underline="True" />
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Latitude" HeaderText="Latitude(X)" Visible="False" />
								<asp:BoundField DataField="Longitude" HeaderText="Longitude(X)" Visible="False" />
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<div class="div_right"><asp:label id="lbl_page" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<br/>
			<!-- 할부상환리스트 시작 -->
			<table id="table_installment_repay" cellpadding="0" cellspacing="0" border="0" width="100%" runat="server" Visible="True">
				<tr>
					<td width="30%"><div class="sub_title_icon"><asp:Literal id="ltr_stitle_installment_list" Text="할부상환리스트" runat="server" /></div></td>
					<td width="70%" style="padding-bottom:4px;">
						<asp:linkbutton id="ibtn_save_repay" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSaveRepay()" OnClick="ibtn_save_repay_Click"></asp:linkbutton>
						<asp:linkbutton id="ibtn_calc" Text="배분" runat="server" CssClass="ibtn ibtn_allocate" OnClientClick="return chkCalcRepay()" OnClick="ibtn_calc_Click"></asp:linkbutton></td>
				</tr>
				<tr>
					<td colspan="2">
						<asp:GridView ID="GridView2" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView2_RowDataBound" DataKeyNames="Seq,Card_Cd">
							<Columns>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:BoundField DataField="Card_Cd" HeaderText="Card_Cd(X)" Visible="False" />
								<asp:BoundField DataField="Card_Nm" HeaderText="카드" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="10%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_Cd" HeaderText="할부코드" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_Nm" HeaderText="결제내용" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="14%" />
								</asp:BoundField>
								<asp:BoundField DataField="Remark" HeaderText="비고" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="14%" />
								</asp:BoundField>
								<asp:BoundField DataField="Ins_Cnt" HeaderText="차수" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Paymnt_Dt" HeaderText="결제예정일" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:TemplateField HeaderText="월불입금">
									<ItemTemplate>
										<asp:TextBox ID="txt_ins_capital" Width="94%" runat="server" CssClass="ib_nb_sR" Text='<%# Bind("Ins_Capital") %>'></asp:TextBox>
									</ItemTemplate>
									<ItemStyle Width="10%" HorizontalAlign="Right" />
									<HeaderStyle CssClass="req" />
								</asp:TemplateField>
								<asp:TemplateField HeaderText="이자">
									<ItemTemplate>
										<asp:TextBox ID="txt_ins_interest" Width="94%" runat="server" CssClass="ib_nb_sR" Text='<%# Bind("Ins_Interest") %>'></asp:TextBox>
									</ItemTemplate>
									<ItemStyle Width="8%" HorizontalAlign="Right" />
									<HeaderStyle CssClass="req" />
								</asp:TemplateField>
								<asp:TemplateField HeaderText="월납입금">
									<ItemTemplate>
										<asp:TextBox ID="txt_ins_month_amt" Width="94%" runat="server" CssClass="ib_nb_sR" Text='<%# Bind("Ins_Month_Amt") %>'></asp:TextBox>
									</ItemTemplate>
									<ItemStyle Width="10%" HorizontalAlign="Right" />
									<HeaderStyle CssClass="req" />
								</asp:TemplateField>
								<asp:TemplateField HeaderText="잔액">
									<ItemTemplate>
										<asp:TextBox ID="txt_ins_balance" Width="94%" runat="server" CssClass="ib_nb_sR" Text='<%# Bind("Ins_Balance") %>'></asp:TextBox>
									</ItemTemplate>
									<ItemStyle Width="10%" HorizontalAlign="Right" />
									<HeaderStyle CssClass="req" />
								</asp:TemplateField>
								<asp:BoundField DataField="Confirm_Yn_Icon" HeaderText="확정" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
									<HeaderStyle Font-Underline="True" />
								</asp:BoundField>
							</Columns>							
						</asp:GridView>
					</td>
				</tr>
			</table>
			<!-- 할부상환리스트 끝 -->
			<div id="div_search_account" class="div_scroll div_multi_box" style="display:none;height:200px;width:200px;position:absolute;overflow-y:auto;">
				<asp:CheckBoxList id="cbl_search_account" runat="server" RepeatDirection="Vertical" CssClass="cbl_vertical"></asp:CheckBoxList>
			</div>
			<!-- 설명 시작 -->
				<ucComment:Comment id="Comment" TagPrefixs="Crd1013m" runat="server"></ucComment:Comment>
			<!-- 설명 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<asp:Label id="lbl_confirm_yn" runat="server"></asp:Label>
				<asp:linkbutton ID="lbtn_confirm" runat="server" OnClick="lbtn_confirm_Click" />
				<asp:linkbutton id="lbtn_init_detail" runat="server" OnClick="lbtn_init_detail_Click" />
				<asp:linkbutton id="lbtn_chg_mode" runat="server" OnClick="lbtn_chg_mode_Click" />
				<input id="h_lbl_mode" type="hidden" name="h_lbl_mode" runat="server" />
				<input id="h_ins_total_cnt" type="hidden" name="h_ins_total_cnt" runat="server" />
				<input id="h_seq" type="hidden" name="h_seq" runat="server" />
				<input id="h_no" type="hidden" name="h_no" runat="server" />
				<input id="h_confirm_yn" type="hidden" name="h_confirm_yn" runat="server" />
			</div>
			<!-- 히든값 끝 -->
			<!-- FilteredTextBoxExtender 시작 -->
			<act:FilteredTextBoxExtender ID="fte_amount"
				runat="server"
				TargetControlID="txt_amount"
				FilterType="Custom, Numbers"
				ValidChars=",">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_ins_total_cnt"
				runat="server"
				TargetControlID="txt_ins_total_cnt"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_latitude"
				runat="server"
				TargetControlID="txt_latitude"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_longitude"
				runat="server"
				TargetControlID="txt_longitude"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			<!-- FilteredTextBoxExtender 끝 -->
			<!-- CalendarExtender 시작 -->
			<act:CalendarExtender ID="ce_search_biz_from_dt"
				runat="server"
				TargetControlID="txt_search_biz_from_dt"
				Format="yyyy-MM-dd"
				PopupButtonID="ci_search_biz_from_dt"
				EnableViewState="False"
				BehaviorID="bi_search_biz_from_dt"
				CssClass="calendar">
			</act:CalendarExtender>
			<act:CalendarExtender ID="ce_search_biz_to_dt"
				runat="server"
				TargetControlID="txt_search_biz_to_dt"
				Format="yyyy-MM-dd"
				PopupButtonID="ci_search_biz_to_dt"
				EnableViewState="False"
				BehaviorID="bi_search_biz_to_dt"
				CssClass="calendar">
			</act:CalendarExtender>
			<act:CalendarExtender ID="ce_biz_dt"
				runat="server"
				TargetControlID="txt_biz_dt"
				Format="yyyy-MM-dd"
				PopupButtonID="ci_biz_dt"
				EnableViewState="False"
				BehaviorID="bi_biz_dt"
				CssClass="calendar">
			</act:CalendarExtender>
			<!-- CalendarExtender 끝 -->
			<!-- 자동완성 시작 -->
			<act:AutoCompleteExtender ID="ace_contents"
				runat="server"
				TargetControlID="txt_contents"
				ServiceMethod="GetSearchData"
				ServicePath="../Common/Inc/AutoCompleteWebService.asmx"
				MinimumPrefixLength="1"
				CompletionSetCount="20"
				CompletionInterval="800"
				EnableCaching="true"
				UseContextKey="true"
				ContextKey="Crd1013m"
				CompletionListCssClass="ace_List"
				CompletionListItemCssClass="ace_ListItem"
				CompletionListHighlightedItemCssClass="ace_HighlightedItem" >
			</act:AutoCompleteExtender>
			<!-- 자동완성 끝 -->
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//검색
	function chkSearch(evt) {
		var e = (!evt) ? window.event : evt;
		var keyCode = e.keyCode;
		
		//날짜형식
		if (!isDateHyphen($F("txt_search_biz_from_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_search_biz_from_dt", keyCode); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
		if (!isDateHyphen($F("txt_search_biz_to_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_search_biz_to_dt", keyCode); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
		
		// 날짜 체크
		if (!isDateSeq($F("txt_search_biz_from_dt"), $F("txt_search_biz_to_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_022), null, null, keyCode); //시작일자가 종료일자보다 늦을수 없습니다
			return false;
		}
		return true;
	}

	//엔터검색
	function enterSearchOnPage(evt) {
		var e = (!evt) ? window.event : evt;
		var keyCode = e.keyCode;

		if (keyCode == 13) {
			if (chkSearch(evt)) {
				__doPostBack('ibtn_search', '');
			}
		}
	}
	
	//저장
	function chkSave() {
		if ($F("txt_biz_dt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_033), setFocus, "txt_biz_dt"); //카드사용일을 입력해 주세요
			return false;
		}
		if ($F("txt_contents").blank()) {
			msgBox.alert(getMsg(MSG_ERR_034), setFocus, "txt_contents"); //결제내용을 입력해 주세요
			return false;
		}
		if ($F("txt_amount").blank()) {
			msgBox.alert(getMsg(MSG_ERR_035), setFocus, "txt_amount"); //결제금액을 입력해 주세요
			return false;
		}
		if ($F("txt_ins_total_cnt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_036), setFocus, "txt_ins_total_cnt"); //총할부차수를 입력해 주세요
			return false;
		}
		if ($F("ddl_ins_st_dt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_144), setFocus, "ddl_ins_st_dt"); //할부시작일을 선택하세요
			return false;
		}
		if ($F("ddl_ins_ed_dt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_145), setFocus, "ddl_ins_ed_dt"); //할부종료일을 선택하세요
			return false;
		}

		//총할부차수와 할부시작일과 종료일의 차이가 다른지 체크
		var st_dt = $F("ddl_ins_st_dt");
		var ed_dt = $F("ddl_ins_ed_dt");

		if ($F("txt_ins_total_cnt") != getDiffMonth(st_dt, ed_dt))
		{
			msgBox.alert(getMsg(MSG_ERR_086)); //총할부차수와 할부개월수의 차이가 다릅니다.
			return false;
		}

		//업데이트 모드이고 총할부차수가 수정되는 경우
		if ($("h_lbl_mode") != null && $F("h_lbl_mode") == "U" && ($F("txt_ins_total_cnt") != $F("h_ins_total_cnt"))) {
			if (!msgBox.confirm(getMsg(MSG_CFM_009), doSave)) {	//총할부차수를 변경할 경우 할부상환리스트는 초기화됩니다. 변경하시겠습니까?
				return false;
			}
		}

		//날짜체크
		if(!isDateHyphen($F("txt_biz_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_biz_dt"); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}

		//날짜체크
		if (!isDateSeq($F("txt_biz_dt"), $F("ddl_ins_st_dt"))) {
			msgBox.alert(getMsg(MSG_ERR_167), null, null); //카드사용일이 할부시작일보다 늦을수 없습니다
			return false;
		}

		var pk = $get("lbl_pk").innerHTML;
		var MSG_ID = (pk == "") ? MSG_CFM_000 : MSG_CFM_028; //저장/수정
		msgBox.confirm(getMsg(MSG_ID), doSave); //저장하시겠습니까?

		return false;
	}
	
	//삭제
	function chkDelete() {
		if(!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_053));	//삭제할 항목을 선택하세요
			return false;
		}
		msgBox.confirm(getMsg(MSG_CFM_005), doDelete);	//삭제하시겠습니까? 확정된 항목은 삭제되지 않습니다
		return false;
	}

	//차수별할부금 계산
	function chkCalcRepay() {
		//할부원금과 총할부차수는 반드시 있어야한다.
		if ($F("txt_amount").blank()) {
			msgBox.alert(getMsg(MSG_ERR_035), setFocus, "txt_amount"); //결제금액을 입력해 주세요
			return false;
		}
		if ($F("txt_ins_total_cnt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_036), setFocus, "txt_ins_total_cnt"); //총할부차수를 입력해 주세요
			return false;
		}
		if ($F("txt_ins_total_cnt") <= 0) {
			msgBox.alert(getMsg(MSG_ERR_024), setFocus, "txt_ins_total_cnt"); //총할부차수는 0보다 커야합니다
			return false;
		}
	}	
	
	//할부상환리스트 저장
	function chkSaveRepay() {
		msgBox.confirm(getMsg(MSG_CFM_012), doRepaySave);	//할부상환리스트를 저장하시겠습니까?
		return false;
	}

	function doRepaySave() {
		if(isMsgBoxYes()) {
			__doPostBack('ibtn_save_repay','');
		}
	}


	//확정(할부상환리스트에서)
	function execConfirm(seq, confirm_yn) {
		$("h_seq").value = seq;
		$("h_confirm_yn").value = confirm_yn;
		__doPostBack('lbtn_confirm','');
	}
	
	//디테일 초기화
	function initDetail() {
		__doPostBack('lbtn_init_detail','');
	}
	
	//페이지모드 변경
	function chgMode() {
		__doPostBack('lbtn_chg_mode','');
	}

	//지도팝업
	function showNaverMapEdit() {
		goNaverMapExEdit($F("txt_latitude"), $F("txt_longitude"), "txt_latitude", "txt_longitude");
	}
	
</script>
</body>
</html>